home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / other / renderlib / doc / debug < prev    next >
Text File  |  1999-06-14  |  1KB  |  43 lines

  1.  
  2. debugging
  3. -----------------------------
  4.  
  5.   render.library provides a rather strict debugging strategy. the
  6.   internal error manager looks like this:
  7.  
  8.     if (parameter_in_valid_range)
  9.     {
  10.         ...
  11.     }
  12.     else
  13.     {
  14.         Exception_ILLEGAL();
  15.         
  16.         /* causing a $80000004 software failure */
  17.     }
  18.  
  19.   it might appear strange at first sight, but this technique is very
  20.   efficient. invalid parameters have got few chance to infiltrate
  21.   the code and play havoc where it becomes really dangerous and hard
  22.   to understand.
  23.  
  24.   the illegal exception (caused by an ILLEGAL opcode) is a 'clean'
  25.   crash without further damage, and it can easily be catched with
  26.   debuggers.
  27.  
  28.   so this exception might become your worst enemy when programming
  29.   render.library. if you encounter dozens of $80000004 requesters
  30.   and can't get rid of them, then it is very likely that the problem
  31.   sits in front of your computer.
  32.  
  33.   this can easily drive you berzerk especially with
  34.   DeleteRMHandler(). if DeleteRMHandler() crashes with an ILLEGAL
  35.   exception, you know exactly that you forgot to free memory, or to
  36.   delete a render.library instance such as palettes, histograms, or
  37.   engines.
  38.  
  39.   this debugging concept is not provided with every function,
  40.   though, but maybe i will apply it to more or even all functions in
  41.   the future. it proved to be a very reliable error treatment, since
  42.   it just cannot be ignored.
  43.